<template>
	<div class="ntlogistics">
		<div class="ntlogistics-title">
			<span class="ntlogistics-title-photo"><img src="../../img-order/pic@3x.png"/></span>
			<div class="ntlogistics-title-xinxi">
				<h3 v-text="htxt">派送中</h3>
				<p>物流公司：<span v-text="expName"></span></p>
				<p>运单编号：<span v-text="mailNo"></span></p>
			</div>
		</div>
		<ul class="ntlogistics-cont">
			<li class="ntlogistics-cont-list" v-for="item in logisticsarr">
				<p class="ntlogistics-list-time"><span v-text="item.timearr2">12:10</span><span v-text="item.timearr1">2017-11-03</span></p>
				<p class="ntlogistics-list-cont" v-text="item.context">快件到达义乌</p>
			</li>
			<!--<li class="ntlogistics-cont-list">
				<p class="ntlogistics-list-time"><span>12:10</span><span>2017-11-03</span></p>
				<p class="ntlogistics-list-cont">快件到达义乌快件到达义乌快件到达义乌快件到达义乌快件到达义乌快件到达义乌快件到达义乌快件到达义乌快件到达义乌快件到达义乌快件到达义乌</p>
			</li>
			<li class="ntlogistics-cont-list">
				<p class="ntlogistics-list-time"><span>12:10</span><span>2017-11-03</span></p>
				<p class="ntlogistics-list-cont">卖家已发货</p>
			</li>-->
		</ul>
	</div>
</template>

<script>
	
	var furl = 'http://www.ntyouxuan.com/';
	export default{
		name:'ntlogistics',
		data () {
			return{
				user:0,
				orderid:0,
				logistics:0,
				logisticsarr:[],
				htxt:'',
				expName:'',
				mailNo:''
			}
		},
		created:function(){
			this.user=localStorage.getItem('nt_user');
			this.orderid=this.$route.query.ordertoken;
			this.logistics=this.$route.query.logis;
		},
		methods:{
			
		},
		mounted:function(){
			var self=this;
			$.ajax({
				type:"post",
				url:furl+"index.php?app=ajax_buyer_order&act=logt",
				data:{'invoice_no':self.logistics,'token':self.user,'order_id':self.orderid},
				dataType:'json',
				success:function(data){
					if(data.done&&data.retval){
						var arr=data.retval.data;
						for(var i=0;i<arr.length;i++){
							arr[i].timearr1=arr[i].time.split(' ')[0];
							arr[i].timearr2=arr[i].time.split(' ')[1].substring(0,5);
							self.logisticsarr[i]=arr[i];
						}
						self.expName=data.retval.expTextName;
						self.mailNo=data.retval.mailNo;
						if(data.retval.status==1){
							self.htxt='暂无记录';
						}
						if(data.retval.status==2){
							self.htxt='在途中';
						}
						if(data.retval.status==3){
							self.htxt='派送中';
						}
						if(data.retval.status==4){
							self.htxt='已签收';
						}
						if(data.retval.status==5){
							self.htxt='已拒签';
						}
					}
				}
			});
			$.ajax({
				type:'post',
				url:furl+'index.php?app=ajax_buyer_order&act=view',
				data:{'token':self.user,'order_id':self.orderid},
				dataType:'json',
				success:function(res){
					self.imgdata=res.retval.order.goods_list[9803].goods_image
					console.log(self.imgdata)
				}
			})
		}
	}
</script>

<style>
	.ntlogistics{margin-top: -0.98rem;font-size:0;}
	.ntlogistics-title{padding:0.32rem;background-color: #fff;overflow: hidden;margin-bottom: 0.16rem;}
	.ntlogistics-title-photo{float:left;display: inline-block;width:1.4rem;height:1.4rem;margin-right: 0.32rem;}
	.ntlogistics-title-photo>img{width:1.4rem;height:1.4rem;}
	.ntlogistics-title-xinxi>h3{font-size:0.4rem;color:#4C9D31;line-height: 0.58rem;font-weight:500;margin-bottom: 0.1rem;}
	.ntlogistics-title-xinxi>p{font-size:0.24rem;color:#999;line-height: 0.36rem;}
	.ntlogistics-cont{background-color:#fff;padding:0.32rem;}
	.ntlogistics-cont li:last-child{border-left:1px solid #fff;}
	.ntlogistics-cont-list{margin-left: 0.8rem;border-left:1px solid #eee;position:relative;min-height: 1.2rem;margin-bottom: 0.26rem;padding-bottom: 0.1rem;}
	.ntlogistics-list-time{width:1.5rem;text-align: center;font-size:0;line-height: 0;position:absolute;top:0;left:-0.75rem;background-color:#fff;padding-bottom: 0.2rem;}
	.ntlogistics-cont li:first-child .ntlogistics-list-time>span:first-child{/*color:#2b2b2b;*/color:#4C9D31;}
	.ntlogistics-cont li:first-child .ntlogistics-list-time>span:last-child{/*color:#666;*/color:#4C9D31;}
	.ntlogistics-cont li:first-child .ntlogistics-list-cont{/*color:#2b2b2b;*/color:#4C9D31;}
	.ntlogistics-list-time>span{display: inline-block;text-align: center;line-height: 0.32rem;}
	.ntlogistics-list-time>span:first-child{font-size:0.32rem;color:#999;}
	.ntlogistics-list-time>span:last-child{font-size:0.24rem;color:#999;}
	.ntlogistics-list-cont{font-size:0.28rem;color:#999;margin-left: 1.12rem;line-height: 0.48rem;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;overflow: hidden;}
</style>